
<template>
<div>
  <div>
    HelloWorld2
  </div>
  <div>
    <button @click="sendToA">发送给组件1</button>
  </div>
</div>
</template>

<script>
import { eventBus } from '@/main'
export default {
  name: 'HelloWorld2',
  data(){
    return{
        childMsg: 'HelloWorld2==msg'
    }
  },
  methods:{
    sendToA(){
      eventBus.$emit('fromBMsg',this.childMsg)
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
